package com.galaxy.coupon.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.coupon.domain.PointsExchangeRule;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.Date;

/**
 * 积分兑换规则业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = PointsExchangeRule.class)
public class PointsExchangeRuleBo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @NotNull(message = "规则ID不能为空", groups = { EditGroup.class })
    private Long id;

    /** 优惠券ID */
    @NotNull(message = "优惠券ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long couponId;

    /** 所需积分 */
    @NotNull(message = "所需积分不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer points;

    /** 每人兑换上限(次) */
    private Integer exchangeLimit;

    /** 兑换开始时间 */
    @NotNull(message = "兑换开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date startTime;

    /** 兑换结束时间 */
    @NotNull(message = "兑换结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date endTime;

    /** 状态(0:未启用,1:已启用,2:已结束) */
    private Integer status;



    /** 规则描述 */
    @Size(min = 0, max = 200, message = "规则描述长度不能超过200个字符")
    private String description;
}
